//
//  homeworkPicView.m
//  ChatDemo-UI2.0
//
//  Created by zz on 16/5/24.
//  Copyright © 2016年 zz. All rights reserved.
//

#import "homeworkPicView.h"

@implementation homeworkPicView

-(instancetype)init{
    
    if (self = [super init]) {
        
        _taskImageView = [[UIImageView alloc] init];
        _taskImageView.contentMode = UIViewContentModeScaleAspectFill;
        _taskImageView.clipsToBounds = YES;
        [self addSubview:_taskImageView];
        
        _numberBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        _numberBtn.titleLabel.font = [UIFont systemFontOfSize:10];
        [_numberBtn setTitleEdgeInsets:UIEdgeInsetsMake(-12, 10, 0, 0)];
        [_numberBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        [_numberBtn setBackgroundImage:[UIImage imageNamed:@"pic_triangle_"] forState:UIControlStateNormal];
        [self addSubview:_numberBtn];
        
        [_taskImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            
            make.left.equalTo(self.mas_left).offset(0);
            make.top.equalTo(self.mas_top).offset(0);
            make.right.equalTo(self.mas_right).offset(0);
            make.bottom.equalTo(self.mas_bottom).offset(0);
            
        }];
        
        [_numberBtn mas_makeConstraints:^(MASConstraintMaker *make) {
           
            make.right.equalTo(self.mas_right).offset(0);
            make.top.equalTo(self.mas_top).offset(0);
            make.height.equalTo(@29);
            make.width.equalTo(@29);
        }];
        
        //[self bringSubviewToFront:_numberBtn];
    }
    
    return self;
}

@end
